<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
	<title>Consultar Postagem</title>
</h:head>
<h:body>
	<h:form id="consultaConhecimento">
		<p:growl id="confirmaChegada" />
		<p:fieldset>
			<h:panelGrid columns="1">
				<h:outputLabel value="Selecione o numero do conhecimento:" />
				<h:panelGrid columns="2">
					<p:inputText id="numeroNotaFiscal" size="8"
						value="#{trechoAction.codNotaFiscal}" />
					<p:commandButton id="buscarNota" value="Procurar"
						image="ui-icon ui-icon-search" 
						actionListener="#{trechoAction.acompanhamentoEntrega}"
						update="confirmaChegada" oncomplete=":consultaViagem"
						title="Procurar Nota Fiscal" />
				</h:panelGrid>
			</h:panelGrid>
			<h:panelGrid>


				<p:dataTable id="consultaViagem" var="TabelaViagem"
					value="#{trechoAction.listandoTrecho}"
					emptyMessage="Não encontrada nenhuma Nota Fiscal!">
					<p:column headerText="Documento">
						<h:outputText value="#{trechoAction.codNotaFiscal}" />
					</p:column>
					<p:column headerText="Origem:">
						<h:outputText value="#{TabelaViagem.rota.destino}" />
					</p:column>
					<p:column headerText="Status:">
						<h:outputText value="#{TabelaViagem.status}" />
					</p:column>
					<p:column headerText="Destino:">
						<h:outputText value="#{TabelaViagem.rota.destino}" />
					</p:column>
					<p:column headerText="Data de Saida:">
						<h:outputText value="#{TabelaViagem.dataSaida}" />
					</p:column>

					<p:column headerText="Data de Chegada:">
						<h:outputText value="#{TabelaViagem.dataChegada}" />
					</p:column>

				</p:dataTable>

			</h:panelGrid>


		</p:fieldset>



	</h:form>
</h:body>


</html>